<?php


namespace app\miniapp\model;


use think\Model;

class OrderModel extends Model
{
    protected $name = 'order';
//    protected $hidden = ['user_id','spec_id','goods_id','pay_time','end_time','create_time','repa_switch',];

    public function getImageAttr($img)
    {
        return request()->domain() . $img;
    }

    public function getSwitchAttr($val)
    {
        if ($val == 0) {
            $val = '待付款';
        }elseif ($val == 1){
            $val = '待收货';
        }elseif ($val == 2){
            $val = '租赁中';
        }elseif ($val == 3){
            $val = '已到期';
        }elseif ($val == 4){
            $val = '已归还';
        }
        return $val;

    }
    public function getRepaSwitchAttr($val)
    {
        if ($val == 0) {
            $val = '未报修';
        }elseif ($val == 1){
            $val = '报修中';
        }elseif ($val == 2){
            $val = '已完成';
        }
        return $val;

    }


}